const { SyncLoopHook } = require("tapable")

const hook = new SyncLoopHook(["name", "age"])

let count1 = 0, count2 = 0
hook.tap("fn1", function (name, age) {
    console.log(`fn1=====>${name},${age}`)
    if (++count1 === 1) {
        count1 = 0
        return undefined
    }
    return true
})


hook.tap("fn2", function (name, age) {
    console.log(`fn2=====>${name},${age}`)
    if (++count2 === 2) {
        return undefined
    }
    return true
})

hook.tap("fn3", function (name, age) {
    console.log(`fn3=====>${name},${age}`)
})

hook.call("lx", 25) 